<?php
 
class Projects {
    /**
     * A list with projects and info about then
     */
    public $projects;
    
    public function __construct() {
    }
    
    
    /**
	 * Method reading the projects list in the projects directory and setting
	 * an array in the tulipIF (PhpGtkEditorIf) object to hold the different projects infos.
	 */
	function ReadProjects()
	{
		$this->projects = array();
		$dir = @opendir(APP_PROJECT);
     
		if ($dir)
		{
			while ($entry = readdir($dir))
			{
				if (($entry != '.') && ($entry != '..') && (substr($entry, -1) != '~')  && (trim($entry) != '.svn') && (trim($entry) != 'CVS'))
				{
        			$proj = parse_ini_file(APP_PROJECT . "/$entry");
                    $this->projects[] = $proj;
                }
			}
		}
	}
}